﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace aaa
{
    class Program
    {
        static void Main(string[] args)
        {
            //连接字符串
            string str = "server=.;database=school;uid=sa;pwd=123456";
            //声明对象
            SqlConnection connection = new SqlConnection(str);
            //指令对象
            string sql = "insert into student values ('','李雷',19,'女','青藏高原')";
            SqlCommand command = new SqlCommand(sql, connection);
            //打开连接
            connection.Open();
            //执行sql命令
            int a = command.ExecuteNonQuery();
            Console.WriteLine(a);
        }
    }
}
